
rem
bbdoc: RGBA component.
about: Used by Renderable and render system.
endrem
Type TColorComponent Extends TComponent {expose hidefields}

	Field _color:TColor
	
	Method New() {hidden}
		_color = New TColor
	End Method
	
	
	Function Create:TColorComponent(r:Int = 255, g:Int = 255, b:Int = 255, a:Float = 1.0) {hidden}
		Local c:TColorComponent = New TColorComponent
		c.Set(r, g, b, a)
		Return c
	End Function
	
	
	rem
	bbdoc: Sets the color and alpha
	endrem
	Method Set(r:Int, g:Int, b:Int, a:Float)
		_color.Set(r, g, b, a)
	End Method
	

	rem
	bbdoc: Applies the color and alpha
	endrem
	Method Apply()
		_color.Use()
	End Method
	
	
	Method GetRed:Int()
		Return _color.GetRed()
	End Method
	
	Method GetGreen:Int()
		Return _color.GetGreen()
	End Method

	Method GetBlue:Int()
		Return _color.GetBlue()
	End Method	
		
	Method GetAlpha:Float()
		Return _color.GetAlpha()
	End Method
	
	
	Method SetAlpha(a:Float)
		_color.SetAlpha(a)
	End Method

End Type
